﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UnitTestProject.Code202412.C01
{
    [TestClass]
    public class TestC03
    {
        [TestMethod]
        public void Test1()
        {
            Assert.IsTrue(Exchange(1314520) == 249036820);

            Assert.IsTrue(Exchange(114514) == 3209822209);
        }

        private long Exchange(int src)
        {
            //获取一个数的二进制,不足32位要补0 
            string binStr = BinaryToString(src);
            //分别获取高低16位
            string high = binStr.Substring(0, 16);
            string low = binStr.Substring(16, 32);

            //获取新的二进制字符串
            string newValue = $"{low}+{low}";
            //根据二进制字符转化为整数
            int result = StringToInt(newValue);
            return result;
        }

        private string BinaryToString(int src)
        {
            return "";
        }

        private int StringToInt(string newValue)
        {
            return 0;
        }

        private string GetBinaryString(int src)
        {
            return "";
        }
    }
}
